<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<style>
.align_top {
	vertical-align: top;
}

.letra {
	font: italic;
	font-size: xx-large;
}
</style>
</h:head>   
<body>
<h:form id="form" enctype="multipart/form-data">
	
 	 
	
	<p:panel id="combosxsalon" header="Asignar Combos de Bebidas a los Salones"
				style="background-color:rgba(0,0,0,0);">
				
								
				<h:panelGrid columns="3" cellpadding="1">
					<h:outputLabel for="combo" value="Combos de Bebidas:" />
					<p:selectOneMenu id="selectCombo" converter="combobebidaConverter"
									value="#{combobebidaxsalonBean.selectedComboBebida}" effect="fade" var="c"
									filter="true" filterMatchMode="startsWith" style="">

									<f:selectItems var="combo" value="#{combobebidaxsalonBean.listComboBebida}"
										itemLabel="#{combo.nombreCombo}" itemValue="#{combo}" />
									<p:column>
										<h:outputText value="#{c.nombreCombo}" />
									</p:column>
					</p:selectOneMenu>
					<br></br>
					
					<h:outputLabel for="salon" value="Salones:" />
					
						<p:selectOneMenu id="selectSalon" converter="salonConverter"
									value="#{combobebidaxsalonBean.selectedSalon}" effect="fade" var="s"
									filter="true" filterMatchMode="startsWith" style="">

									<f:selectItems var="salon" value="#{combobebidaxsalonBean.listSalones}"
										itemLabel="#{salon.nombreSalon}" itemValue="#{salon}" />
									<p:column>
										<h:outputText value="#{s.nombreSalon}" />
									</p:column>
					</p:selectOneMenu>
					
					<br></br><br></br>
					<h:outputLabel for="precio" value="Precio:$" />
					<p:inputText value="#{combobebidaxsalonBean.combobebidaxsalon.precio}" style="width:200px"> </p:inputText>
					
					</h:panelGrid>
					<br>
					
					</br>
					<p:commandButton value="Agregar" id="btnAgregarCombos" icon="ui-icon-disk" process="@this,combosxsalon"
								update="singleDT" action="#{combobebidaxsalonBean.agregarCombo}" />

			<p:dataTable id="singleDT" var="cbxs" value="#{combobebidaxsalonBean.listComboBebidaXSalon}"
				selection="#{combobebidaxsalonBean.combobebidaxsalonSelected}"
				rowKey="#{cbxs.combobebidaxsalon.combobebida.nombreCombo}" editable="true" style="width:50%"
				rows="5" paginator="true" paginatorPosition="bottom"
				paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}">

								
				<p:column headerText="Combo Bebida">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{cbxs.combobebida.nombreCombo}" />
						</f:facet>
						<f:facet name="input">
											<p:inputText id="comboInput"
												value="#{cbxs.combobebida.nombreCombo}" style="width:100%" />
										</f:facet>
					</p:cellEditor>
				</p:column>
				<p:column headerText="Salon">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{cbxs.salon.nombreSalon}" />
						</f:facet>
						<f:facet name="input">
											<p:inputText id="salonInput"
												value="#{cbxs.salon.nombreSalon}" style="width:100%" />
										</f:facet>
					</p:cellEditor>
				</p:column>
				<p:column headerText="Precio" style="text-align:left">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{cbxs.precio}" />
						</f:facet>
						<f:facet name="input">
											<p:inputText id="precioInput"
												value="#{cbxs.precio}" style="width:100%" />
										</f:facet>
					</p:cellEditor>
				</p:column>
				
				<p:column headerText="Eliminar"
					style="width:32px;text-align: center">
					<p:commandButton process="@this"
						update="singleDT" icon="ui-icon-close"
						title="View" action="#{combobebidaxsalonBean.eliminarCombo}">
						<f:setPropertyActionListener value="#{cbxs}"
											target="#{combobebidaxsalonBean.combobebidaxsalonSelected}" />
					</p:commandButton>
				</p:column>
				
				 
			</p:dataTable>

			
	<p:commandButton value="Registrar"	action="#{combobebidaxsalonBean.guardarComboBebidaXSalon}"	styleClass="ui-priority-primary" />
	
			
	</p:panel>
	
	 
</h:form>

</body>
</html>	






